/**
 *                     Remixvym (version 0.8.3)
 *             Copyright (c) 2010 by RemixLab, DISI-UNAL
 *            http://www.disi.unal.edu.co/grupos/remixlab/
 *
 * This Java package provides classes to visualize Mind Maps created in VYM
 * (View Your Mind) in a Processing Sketch
 *
 * @author Alvaro Lopez, Juan Baquero
 *
 * This source file is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 3 of the License, or (at your option)
 * any later version.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * A copy of the GNU General Public License is available on the World Wide Web
 * at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by
 * writing to the Free Software Foundation, 51 Franklin Street, Fifth Floor
 * Boston, MA 02110, USA
 */
package remixlab.remixvym.core.graphics.link;

import processing.core.PApplet;
import processing.core.PGraphics;
import remixlab.remixvym.core.graphics.StyleGraph;
import remixlab.remixvym.core.mindmap.Node;

/** 
 * Wrapper class for drawing links.
 * 
 * Draw the connection link between two nodes using any class that 
 * implements LinkForm {@link remixlab.remixvym.core.graphics.link.LinkForm}.
 * 
 * @param {@link remixlab.remixvym.core.graphics.StyleGraph} st  The style setup.
 */
public class LinkGraph {
	
	public LinkGraph(StyleGraph st)
	{
		style = st;
		changeStyle();
	}

	/**Wrapper method. Use the reference kept in {@link #linkType}*/
	public void drawLink(Node node, PApplet parent, PGraphics pg){
		if (node.hide)
			return;

		linkType.drawLine(node, parent, pg);
	}
	
	public void changeStyle ()
	{
		linkType = style.getLinkStyle();
	}

	private LinkForm linkType;
	private StyleGraph style;


}
